package indi.zhifa.recipe.bailan.framework.auth.entity.dto.user;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


@Data
public class BaseSignInDto {
    @NotNull(message = "账号名不可为空")
    @Length(min=3,max=20,message = "用户名需要在3~20个字符内")
    @Schema(title = "用户名")
    private String name;

    @Pattern(
            regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d$@$!%*?&]{8,16}",
            message = "密码必须同时包含大小写字母、数字及特殊字符，长度7-32位"
    )
    @Schema(title = "密码")
    private String password;
}
